package com.huawei.appmarket.oobe.app;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import com.huawei.appgallery.serverreqkit.api.bean.startup.StartupResponse$OOBEAppInfo;
import com.huawei.appmarket.oobe.app.aidl.OOBELauncherTaskInfo;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import o.dld;
import o.dlp.b;
import o.Logger;
import o.dof;

public class OOBELauncherService extends Service {
    private d ˏ = new d(this);

    class d extends b {
        final /* synthetic */ OOBELauncherService ˋ;

        d(OOBELauncherService oOBELauncherService) {
            this.ˋ = oOBELauncherService;
        }

        public byte[] ˏ() throws RemoteException {
            Logger.ˎ("OOBE", "OOBELauncherInterface.getLayoutData allset=" + dld.ˎ().ʻ());
            String str = "";
            List ᐝ = dld.ˎ().ᐝ();
            String ॱˊ = dld.ˎ().ॱˊ();
            if (ᐝ.isEmpty()) {
                ॱˊ = str;
            } else if (dof.ˋ(ॱˊ)) {
                ॱˊ = "";
            }
            byte[] bArr = new byte[0];
            try {
                return ॱˊ.getBytes("UTF-8");
            } catch (UnsupportedEncodingException e) {
                Logger.e("OOBE", "OOBELauncherInterface.getLayoutData UnsupportedEncodingException");
                return bArr;
            }
        }

        public List<OOBELauncherTaskInfo> ˊ() throws RemoteException {
            Logger.ˎ("OOBE", "OOBELauncherInterface.getOOBETaskInfo allset=" + dld.ˎ().ʻ());
            List<OOBELauncherTaskInfo> arrayList = new ArrayList();
            if (!dld.ˎ().ᐝ().isEmpty()) {
                for (StartupResponse$OOBEAppInfo startupResponse$OOBEAppInfo : dld.ˎ().ͺ()) {
                    OOBELauncherTaskInfo oOBELauncherTaskInfo = new OOBELauncherTaskInfo();
                    oOBELauncherTaskInfo.ˎ(startupResponse$OOBEAppInfo.ʼ());
                    oOBELauncherTaskInfo.ˊ(startupResponse$OOBEAppInfo.ˏ());
                    oOBELauncherTaskInfo.ॱ(startupResponse$OOBEAppInfo.ˎ());
                    arrayList.add(oOBELauncherTaskInfo);
                }
            }
            return arrayList;
        }
    }

    public IBinder onBind(Intent intent) {
        Logger.ˎ("OOBE", "OOBELauncherService onBind");
        String action = intent.getAction();
        if (action == null || !action.equals("com.huawei.appmarket.oobe.ACTION_BIND_OOBE_LAUNCHER_SERVICE")) {
            return null;
        }
        return this.ˏ;
    }

    public boolean onUnbind(Intent intent) {
        Logger.ˎ("OOBE", "OOBELauncherService onUnbind");
        return super.onUnbind(intent);
    }
}
